export default {
  data() {
    return {
      identifyCodes: '1234567890'
    };
  },
  methods: {
    randomNum(min, max) {
      return Math.floor(Math.random() * (max - min) + min);
    },
    refreshCode(isLogin) { // 刷新验证码 , 参数为1时刷新登录表单的验证码，为0刷新重置密码的验证码
      this.identifyCode = '';
      this.pwdIdentifyCode = '';
      for (let i = 0; i < 4; i++) {
        isLogin ? this.identifyCode += this.identifyCodes[this.randomNum(0, this.identifyCodes.length)] : this.pwdIdentifyCode += this.identifyCodes[this.randomNum(0, this.identifyCodes.length)];
      }
    }
  }
};
